package com.hit.aircraftwar.difficulty;

import com.hit.aircraftwar.aircraft.AbstractAircraft;
import com.hit.aircraftwar.creator.Creator;
import com.hit.aircraftwar.creator.EliteEnemyCreator;
import com.hit.aircraftwar.creator.MobEnemyCreator;
import com.hit.aircraftwar.setter.ParameterSet;

/**
 * @author LiuYuZhe
 */
public class EasyDiff extends DifficultyClass {

    ParameterSet parameterSet = ParameterSet.getInstance();
    Creator creator;

    static {
        System.out.println("简单模式下难度不随时间变化！");
    }

    @Override
    AbstractAircraft creatEnemy(int enemySize, int timeWithoutElite, int score) {
        AbstractAircraft aircraft = null;
        if (enemySize < parameterSet.getMaxEnemy()) {
            if (parameterSet.noElite() && timeWithoutElite >= parameterSet.getEliteInterval()) {
                creator = new EliteEnemyCreator();
                aircraft = (AbstractAircraft) creator.creatObject();
                parameterSet.setHasElite(true);
                System.out.println("精英敌机出现！");
            } else {
                creator = new MobEnemyCreator();
                aircraft = ((AbstractAircraft) creator.creatObject());
            }
        }
        return aircraft;
    }

    @Override
    double updateEnemyAttributes(int time) {
        return 0;
    }
    @Override
    int updateCycleDuration(int time) {
        return 0;
    }
}
